function [ endpoints signature ] = getEndpointsFromCurvature( bwImage, kernelRadius, sigma, threshold, sigmaAdjusted)
%GETENDPOINTSFROMIMAGE Summary of this function goes here
%   Detects endpoints with a specified kernelRadius, sigma and threshold. 
%   Automatically adjusts sigma until at most 2 enpoints are detected.
%   sigma = 1; 
    [endpoints signature] = detectEndpoints(bwImage, kernelRadius, sigma, threshold);
    if sigmaAdjusted
        firstEndpoints = endpoints;

        while size(endpoints,1) > 2
            sigma = sigma * 1.2;
            [endpoints signature] = detectEndpoints(bwImage, kernelRadius, sigma, threshold);
        end
    end
    
end
    
    
    

